var baseUrl="https://xincai.xinduiapp.com";
// var baseUrl="http://192.168.10.156:8080";

var appUrl="https://h5xindui.ubrie.com";

var shareUrl="https://h5xindui.ubrie.com/xincai2?url=";
var httpUrl="https://h5xindui.ubrie.com/xincai2/";

var mainUrl="https://xincai.xinduiapp.com/stx/xincai";

var ajaxFun=function(type,url,data,success){
	$.ajax({
		type: type,
		url: baseUrl+url,
		data: data,
		// dataType: 'json',
		timeout: 3000,
		success: function(data){
		    success(data);
	    },
	    error: function(xhr, type){
	        // alert('Ajax error!')
	    }
	})
}
var ajaxFun1=function(type,url,data,success){
	$.ajax({
		type: type,
		url: appUrl+url,
		data: data,
		dataType: 'json',
		timeout: 3000,
		success: function(data){
		    success(data);
	    },
	    error: function(xhr, type){
	        // alert('Ajax error!')
	    }
	})
}

var showLayer=function(mes){
	layer.open({
	    content: mes
	    ,skin: 'msg'
	    ,time: 2 //2秒后自动关闭
	});
}



var GetQueryString=function(name)
{
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}

function hideMenuReady() {
    WeixinJSBridge.call('hideOptionMenu');
}

var hideMenu=function(){
	if (typeof WeixinJSBridge == "undefined") {
	    if (document.addEventListener) {
	        document.addEventListener('WeixinJSBridgeReady', hideMenuReady, false);
	    } else if (document.attachEvent) {
	        document.attachEvent('WeixinJSBridgeReady', hideMenuReady);
	        document.attachEvent('onWeixinJSBridgeReady', hideMenuReady);
	    }
	} else {
	    hideMenuReady();
	}
}

function showMenuReady() {
    WeixinJSBridge.call('showOptionMenu');
}
var showMenu=function(){
	if (typeof WeixinJSBridge == "undefined") {
	    if (document.addEventListener) {
	        document.addEventListener('WeixinJSBridgeReady', showMenuReady, false);
	    } else if (document.attachEvent) {
	        document.attachEvent('WeixinJSBridgeReady', showMenuReady);
	        document.attachEvent('onWeixinJSBridgeReady', showMenuReady);
	    }
	} else {
	    showMenuReady();
	}
	
}

var getTime=function(time){
    var myDate = new Date(time);
    var u = navigator.userAgent;
    var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
    var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
    if(isiOS){
       var t = new Date(time.replace(/-/g,'/')).getTime();
    }else{
         var t = myDate.getTime();
    }
    return t;
}
var getDay=function(time){
    var day=parseInt(time/(60*60*24*1000));
    return day;
}
var getHour=function(time){
  var day=parseInt(time/(60*60*24*1000));
  var hour=parseInt((time-day*60*60*24*1000)/(1000*60*60));
  return hour;
}
var getMiute=function(time){
  var day=parseInt(time/(60*60*24*1000));
  var hour=parseInt((time-day*60*60*24*1000)/(1000*60*60));
  var minut=parseInt((time-hour*1000*60*60-day*60*60*24*1000)/(1000*60));
  return minut;
}



$(function(){
	 $(".nav_footer>li").click(function() {
	 	 var href=$(this).attr('data-href');
	 	 window.location.href=href;
	 });

});